package com.ruoyi.web.controller.module.thirdpard;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.thirdpart.domain.MapLocation;
import com.ruoyi.thirdpart.service.IMapLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 地图
 * 
 * @author ruoyi
 */
@RestController
@RequestMapping("/thirdpart/map")
public class MapLocationController extends BaseController
{
    @Autowired
    private IMapLocationService mapLocationService;

    /**
     * 地图 逆地理解析
     */
    @GetMapping("/reverseAddressResolution")
    public AjaxResult reverseAddressResolution(MapLocation map)
    {
        AjaxResult ajax = AjaxResult.success();
        MapLocation mapLocation = mapLocationService.geocoder(map.getLon(), map.getLat());
        ajax.put(AjaxResult.DATA_TAG, mapLocation);
        return ajax;
    }
}
